Skip to content

Don't ICE on packed structs in a static. #9832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 13, 2013
Merged

Don't ICE on packed structs in a static. #9832

merged 3 commits into from
Oct 13, 2013

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Oct 13, 2013

Fixes #9830.

@alexcrichton
Copy link
Member

Are we sure that this is the only spot? Can you match on packed structs in match clauses? I suppose we're already guaranteed that the literals themselves work, just trying to think of wherever static structs can be used...

@huonw
Copy link
Member

huonw commented Oct 13, 2013

git grep -C 5 'C_struct' shows a few instances of C_struct(...) seemingly without a corresponding C_packed_struct, although I guess many are related to enums rather than structs.

(FWIW, it seems like it would be reasonable to just merge C_struct and C_packed_struct with a packed: bool parameter; it'd certainly make bugs like this less common if the author has to think about what to put there.)

bors added a commit that referenced this pull request Oct 13, 2013
@bors bors closed this Oct 13, 2013
@bors bors merged commit e88064d into rust-lang:master Oct 13, 2013
@luqmana luqmana deleted the sps branch October 13, 2013 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

static instance of #[packed] struct makes Rustc fail
4 participants